<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>配送列表</title>
    <link rel="shortcut icon" href="favicon.ico">
    <script src="../../res/js/comm.js"></script>
    <link href="../../res../res/plugins/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css" rel="stylesheet">
     <script src="../../js/wms/select.js"></script>
    <script src="../../res/js/ajaxUtil.js"></script>
    <style>
        tr a{
            width: auto;
            line-height: 26px;
        }
        .select2-container--open {
        z-index: 10000000000
    }
    </style>
</head>

<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="panel panel-info">
        <div class="panel-heading"><i class="fa fa-info-circle"></i> 配送列表</div>
        <div class="panel-body">
            <div class="ibox-query">
                <form id="queryForm" method="post" class="form-horizontal">
                    <input name="deliveryStatus" type="hidden">
                    <div class="form-group">
                        <label class="col-sm-1 control-label">顶级渠道</label>
                        <div class="col-sm-2" name="channelPluginsDiv"></div>
                        <label class="col-sm-1 control-label">订单编码</label>
                        <div class="col-sm-2"><input name="orderCode" class="form-control" type="text"></div>

                        <label class="col-md-1 control-label">物流公司</label>
                        <div class="col-sm-2" name="partnerPluginsDiv"></div>

                        <label class="col-md-1 control-label">运单号</label>
                        <div class="col-sm-2"><input name="waybillCode" class="form-control" type="text"></div>
                    </div>
                    <div class="form-group">
                      
                        <label class="col-sm-1 control-label">开始时间</label>
                        <div class="col-sm-2"><input class="layui-input" id='createStartTime' name="createStartTime" title='发货开始时间' placeholder="发货开始时间" type="text" readonly onclick="layui.laydate({elem: this, istime: true, format: 'YYYY-MM-DD hh:mm:ss'})"> </div>
                      
                        <label class="col-sm-1 control-label">结束时间</label>
                        <div class="col-sm-2"><input class="layui-input" id='createEndTime' name="createEndTime" title='发货结束时间'  placeholder="发货结束时间" type="text" readonly   onclick="layui.laydate({elem: this, istime: true, format: 'YYYY-MM-DD hh:mm:ss'})"> </div>

                        <label class="col-sm-1 control-label">门店编码</label>
                        <div class="col-sm-2"><input class="layui-input" id='warehouseCode' name="warehouseCode"   placeholder="门店编码" type="text"> </div>

                        <label class="col-sm-1 control-label">问题运单</label>
                        <div class="col-sm-2">
                            <div class="radio radio-info radio-inline">
                                <input type="radio" name="problemWaybill" id="problemWaybill1" value="" onclick="$.openx.query()" />
                                <label for="problemWaybill1">全部</label>
                            </div>
                            <div class="radio radio-info radio-inline">
                                <input type="radio" name="problemWaybill" id="problemWaybill2" value="YES" onclick="$.openx.query()" />
                                <label for="problemWaybill2">是</label>
                            </div>
                            <div class="radio radio-info radio-inline">
                                <input type="radio" name="problemWaybill" id="problemWaybill3" value="NO" onclick="$.openx.query()" />
                                <label for="problemWaybill3">否</label>
                            </div>
                        </div>
                        </div>

                    <div class="form-group">
                        <div class="col-sm-9"> </div>
                        <div>
                            <button style="margin-left: 100px;" class="btn btn-info" onclick='$.openx.query()' type="button"><i class="glyphicon glyphicon-search"></i> 查询</button>
                            <button style="margin-left: 10px;" class="btn btn-info" onclick="resetForm()" type="button"><i class="glyphicon glyphicon-share-alt"></i> 重置  </button>
                        </div>
                    </div>

                    <div class="hr-line-dashed"></div>
                </form>
            </div>

            <div class="row row-lg">
                <div class="col-sm-12">
                    <div class="bars pull-left">
                        <p>
                            <button type="button" name="batchPrint" onclick="batchPrint()" class="btn btn-sm btn-warning" style="margin-right: 20px"><i></i> 批量打印</button>
                            <button type="button" name="deliveryStatus" value="" class="btn btn-sm btn-success"><i  class="glyphicon glyphicon-ok-sign"></i> <small>全部</small></button>
                            <button type="button" name="deliveryStatus" value="DELIVERING"   class="btn btn-sm btn-info"><i></i> 配送中</button>
                            <button type="button" name="deliveryStatus" value="DELIVERY_FINISHED" class="btn btn-sm btn-warning"><i></i> 配送完成</button>
                            <button type="button" name="deliveryStatus" value="DELIVERY_EXCEPTION" class="btn btn-sm btn-danger"><i></i> 配送异常</button>
                            <button type="button" name="deliveryStatus" value="DELIVERY_CANCEL" class="btn btn-sm btn-default"><i></i> 配送取消</button>
                            <marquee direction="right" width="400px" scrollamount='2' behavior="alternate"><font color='red'>达达、蜂鸟物流 支持手动取消发货和重新发货操作</font></marquee>
                        </p>
                    </div>
                    <table id="table" data-show-export="true">
                        <thead>
                        <tr>
                            <th data-field="stats" data-checkbox="true"></th>
                            <th data-align="center" visible="false" data-field="id" data-formatter="$.openx.generatorId"> 序号</th>
                            <th data-align="center" data-formatter="showOrderDetailFormat" data-width="400px">操作</th>
                            <th data-align="center" data-field="orderCode" data-formatter="showLogisticsDetail">订单号</th>
                            <th data-align="center" data-field="waybillCode">运单号</th>
                            <th data-align="center" data-field="deliveryPartner" data-width="90px">配送方</th>
                            <th data-align="center" data-field="statusName" >配送状态</th>
                            <th data-align="center" data-field="deliveryTime" data-formatter="dateFormat">发货时间</th>
                            <th data-align="center" data-field="senderAddress" data-visible="false">发货地址</th>
                            <th data-align="center" data-field="orderIsCancel" data-formatter="orderIsCancelFormat">订单描述</th>
                            <th data-align="center" data-field="deliveryDetail">物流详情</th>
                            <th data-align="center" data-field="receiverAddress">收货地址</th>
                            <th data-align="center" data-field="receiverName">收货人</th>
                            <th data-align="center" data-field="remark">备注</th>
                            <th data-align="center" data-field="problemWaybill" data-formatter="problemWaybillFormatter">问题运单</th>
                            <th data-align="center" data-field="problemWaybillDesc">问题运单描述</th>
                        </tr>
                        </thead>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>

<script type="text/html" id="deliveryDetailTpl">
    <div style="padding: 10px">
        <table class="layui-table">
            <tbody>
            <tr>
                <td rowspan="4"  class="layui-table-td-bg">基本信息:</td>
                <td class="layui-table-td-bg">物流编码</td>
                <td class="text-center" width="150px">   {{d.deliveryCode ? d.deliveryCode :"" }}    </td>
                <td class="layui-table-td-bg">订单号</td>
                <td class="text-center">{{d.orderCode ? d.orderCode :"" }}</td>
                <td class="layui-table-td-bg">拣货码</td>
                <td class="text-center">{{d.pickSerialNumber ? d.pickSerialNumber : 0 }}</td>
            </tr>
            <tr>
                <td class="layui-table-td-bg">物流状态</td>
                <td class="text-center">{{d.deliveryStatus ? d.deliveryStatus : ""}}</td>
                <td class="layui-table-td-bg">发货时间</td>
                <td class="text-center">{{d.deliveryTime ? d.deliveryTime :"" }}</td>
                <td class="layui-table-td-bg">快递类型</td>
                <td class="text-center">{{d.deliveryType ? d.deliveryType :"" }}</td>
            </tr>
            <tr>
                <td class="layui-table-td-bg">运单号</td>
                <td class="text-center">{{d.waybillCode ? d.waybillCode :"" }}</td>
                <td class="layui-table-td-bg">配送方</td>
                <td class="text-center">{{d.deliveryPartner ? d.deliveryPartner :"" }}</td>
                <td class="layui-table-td-bg">是否货到付款</td>
                <td class="text-center">{{d.isCashOnDelivery ? d.isCashOnDelivery : ""}}</td>
            </tr>
            <tr>
                <td class="layui-table-td-bg">代收款的金额</td>
                <td class="text-center">{{d.agencyFund ? d.agencyFund: "0.00"}}</td>
                <td class="layui-table-td-bg">渠道名称</td>
                <td class="text-center">{{d.topChannelName ? d.topChannelName :""}}</td>
            </tr>
            <tr>
                <td rowspan="1"  class="layui-table-td-bg">发货人信息</td>
                <td class="layui-table-td-bg">发货人姓名</td>
                <td class="text-center">{{d.senderName ? d.senderName :"" }}</td>
                <td class="layui-table-td-bg">发货人电话</td>
                <td class="text-center">{{d.senderPhone?d.senderPhone:""}}</td>
                <td class="layui-table-td-bg">发货人地址</td>
                <td class="text-center">{{d.senderAddress?d.senderAddress:""}}</td>
            </tr>
            <tr>
                <td rowspan="1"  class="layui-table-td-bg">收件人信息</td>
                <td class="layui-table-td-bg">收件人姓名</td>
                <td class="text-center">{{d.receiverName?d.receiverName:""}}</td>
                <td class="layui-table-td-bg">收件人电话</td>
                <td class="text-center">{{d.receiverPhone?d.receiverPhone:""}}</td>
                <td class="layui-table-td-bg">收件人地址</td>
                <td class="text-center">{{d.receiverAddress?d.receiverAddress:""}}</td>
            </tr>
            <tr>
                <td rowspan="1" class="layui-table-td-bg" >备注:</td>
                <td colspan="7">{{d.remark?d.remark:""}}</td>
            </tr>
            </tbody>
        </table>
    </div>
</script>


<script type="text/html" id="logisticsInfotpl">
    <div id="vertical-timeline" class="vertical-container dark-timeline">
        <div class="vertical-timeline-block" style="padding: 0px;margin-bottom: 10px;margin-top: 10px">
            <div class="vertical-timeline-icon navy-bg">
                <i class="fa fa-commenting-o"></i>
            </div>
            <div class="vertical-timeline-content" style="padding: 4px;">
                <p> &nbsp;<b>物流公司：{{d.logisticsName ? d.logisticsName:"无"}}</b> &nbsp; &nbsp;<b>运单号：{{d.waybillCode?d.waybillCode:"无"}}</b> &nbsp; &nbsp;<b>配送状态：{{d.deliveryStatusDesc?d.deliveryStatusDesc:"无"}}</b></p>
            </div>
        </div>
        {{# layui.each(d.traceInfos, function(index, item){ }}
        <div class="vertical-timeline-block" style="padding: 0px;margin-bottom:10px;margin-top: 10px">
            <div class="vertical-timeline-icon navy-bg">
                <i class="fa fa-truck"></i>
            </div>
            <div class="vertical-timeline-content" style="padding: 2px">
                <p style="margin-bottom: 1px;padding-bottom: 12px;"> {{item.nodeDesc ? item.nodeDesc:""}}   &nbsp;&nbsp;&nbsp;&nbsp;<b>{{item.nodeTime ? item.nodeTime :""}}  </b></p>
            </div>
        </div>
        {{# }); }}
    </div>
</script>

<script type="text/html" id="logisticsComplainTpl">
    <form class="form-horizontal" id="logisticsComplainForm">
        <div class="col-md-12" style="width: 400px;margin-top: 20px">
            <div class="form-group">
                <label class="col-sm-4 control-label"><font color="red">* </font>投诉类型：</label>
                <div class="col-sm-8">
                    <select name="complainId" id="complainId" class="form-control" required="true" placeholder="请选择投诉类型">
                        <option value="">请选择投诉类型</option>
                        {{# layui.each(d, function(index, item){ }}
                        <option value="{{item.id}}">{{item.reason}}</option>
                        {{# }); }}
                    </select>
                </div>
            </div>
        </div>
    </form>
</script>


<script type="text/html" id="listPartnsssserTpl">
        {{# layui.each(d.traceInfos, function(index, item){ }}
        <div class="vertical-timeline-block" style="padding: 0px;margin-bottom:10px;margin-top: 10px">
            <div class="vertical-timeline-icon navy-bg">
                <i class="fa fa-truck"></i>
            </div>
            <div class="vertical-timeline-content" style="padding: 2px">
                <p style="margin-bottom: 1px;padding-bottom: 12px;"> {{item.nodeDesc ? item.nodeDesc:""}}   &nbsp;&nbsp;&nbsp;&nbsp;<b>{{item.nodeTime ? item.nodeTime :""}}  </b></p>
            </div>
        </div>
        {{# }); }}
    </div>
</script>


<script type="text/html" id="listPartnerTpl">
    <form class="form-horizontal" id="addDeliveryTypeForm">
        <div class="col-md-12" style="margin-top: 20px">
            <div class="form-group">
                <label class="col-sm-4 control-label">选择发货方式：</label>
                <div class="col-sm-8">
                    {{# layui.each(d, function(index, item){ }}
                    <div class="radio radio-info radio-inline">
                        <input type="radio" name="partnerId" id="statusRadio{{index}}"  value="{{item.logisticsId}}" />
                        <label for="statusRadio{{index}}"> {{item.name}} </label>
                    </div>
                    {{# }); }}

                </div>
            </div>
        </div>
    </form>
</script>




<script type="text/html" id="problemWaybillTpl">
    <div style="padding: 10px">
        <table class="layui-table" id = "tableproblemWaybill">
            <tbody>
                <tr>
                    <td  class="layui-table-td-bg">问题描述:</td>
                    <td class="text-center">
                        <textarea rows="6" cols="40" placeholder="最多输入250个字" maxlength=250 style="width:100%" name="problemWaybillDesc">{{!d.problemWaybillDesc ? "":d.problemWaybillDesc}}</textarea>
                    </td>
                </tr>
                <tr>
                    <td  class="layui-table-td-bg">运单状态:</td>
                    <td class="text-left">
                        <div class="radio radio-info radio-inline">
                            <input type="radio" name="problemWaybill" {{d.problemWaybill == 'YES'?'checked':''}}  id="problemWaybill4" value="YES"/>
                            <label for="problemWaybill4">问题运单</label>
                        </div>
                        <div class="radio radio-info radio-inline">
                            <input type="radio" name="problemWaybill" id="problemWaybill5" {{ d.problemWaybill== 'NO' ? 'checked':''}} value="NO"/>
                            <label for="problemWaybill5">运单正常</label>
                        </div>
                    </td>
                </tr>
            </tbody>
        </table>
    </div>
</script>
</body>

<script type="text/html" id="modifyAddressDialog">
    <form class="form-horizontal" id="modifyAddressForm">
        <input id="orderCode" type="hidden" name="orderCode" value="{{!d.orderCode ? '':d.orderCode}}"/>
        <input id="add_receive_provinceId" type="hidden" name="provinceName"/>
        <input id="add_receive_cityId" type="hidden" name="cityName"/>
        <input id="add_receive_districtId" type="hidden" name="districtName"/>
        <div class="col-md-12" style="width: 800px;margin-top: 50px">
            <div class="form-group" >
                <label class="col-md-4 control-label"><i class="snowflake"></i>收件人姓名：</label>
                <div class="col-sm-8" >
                    <input name="name" id="name" class="form-control" style="width: 150px;" placeholder="收件人姓名" type="text" title="必填字段" required="true" >
                </div>
            </div>
            <div class="form-group" >
                <label class="col-md-4 control-label"><i class="snowflake"></i>收件人姓名：</label>
                <div class="col-sm-8" >
                    <input name="phone" id="phone" class="form-control" style="width: 150px;" placeholder="收件人电话" type="text" title="必填字段" required="true" >
                </div>
            </div>
            <div class="form-group" >
                <label class="col-md-4 control-label"><i class="snowflake"></i>收货(省/市/区): </label>
                <div class="col-sm-8" >
                    <select id="receive_add_province" name="provinceCode" style="width: 150px;" placeholder="请选择省/直辖市"  required="true">
                        <option value="">请选择省/直辖市</option>
                    </select>
                    <select id="receive_add_city" name="cityCode" style="width: 150px;">
                        <option value="">请选择市</option>
                    </select>
                    <select id="receive_add_district" name="districtCode" style="width: 150px;">
                        <option value="">请选择区</option>
                    </select>
                </div>
            </div>
            <div class="form-group" >
                <label class="col-md-4 control-label"><i class="snowflake"></i>详细地址：</label>
                <div class="col-sm-8" >
                    <input type="text" name="detailAddress" id="detailAddress" class="form-control" style="width: 400px;" placeholder="详细地址"  title="必填字段" required="true" >
                </div>
            </div>
        </div>
    </form>
</script>
<script type="text/javascript">
    (function () {
        $.openx.loadScript(['../../res/plugins/yifeng/channel.js','../../res/plugins/yifeng/partner.js', '../../js/logistics/deliveryList.js']);
    })();
</script>

</html>
